// JavaScript Document

var focusEleId;
var returnURL;

function showAlert(title, message, idFocus){	
	focusEleId = idFocus;
	$('#window-title').text(title);
	$('#window-message').text(message);
	$('#alert-dialog').show();
}

function hideAlert(){
	$('#alert-dialog').hide();
	if(focusEleId != '')
		$('#'+focusEleId).focus();
}

function showConfirm(title, message, url){
	returnURL = url;
	$('#confrim-window-title').text(title);
	$('#confrim-window-message').text(message);
	$('#confirm-dialog').show();
}

function hideConfirmAlert(){
	$('#confirm-dialog').hide();
}

function checkEmailAddr(email){
	var pattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}(\.[a-zA-Z]{2,3}){0,1}$/;
	return pattern.test(email);
}

$(document).ready(function(e) {
    $('#button-yes').click(function(e) {
		window.location = returnURL;
    });
});